import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { SysComponent } from './sys.component';
import { UserComponent } from './user/user.component';
import { RoleComponent } from './role/role.component';
import { ProfileComponent } from './profile/profile.component';
import { ConfigComponent } from './config/config.component';

const routes: Routes = [{
  path: '',
  component: SysComponent,
  children: [{
    path: 'user',
    component: UserComponent,
  }, {
    path: 'role',
    component: RoleComponent,
  }, {
    path: 'config',
    component: ConfigComponent,
  }, {
    path: 'profile',
    component: ProfileComponent,
  }],
}];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class SysRoutingModule { }

export const routedComponents = [
  SysComponent,
  UserComponent,
  RoleComponent,
  ProfileComponent,
  ConfigComponent,
];
